/*
 * @Author: wuheng wuheng@szhbzc.com
 * @Date: 2024-12-03 14:18:59
 * @LastEditors: wuheng wuheng@szhbzc.com
 * @LastEditTime: 2025-02-13 12:07:36
 * @FilePath: \web-appc:\Users\wuheng\Desktop\WugangNew\src\api\Newuser.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import request from "@/utils/newrequst";

// 登录接口
export const getLogin = (data: any) => {
  return request({
    url: `/system/v1/user/login/`, method: "post", data
  });
};
// 权限查询
export const reqUserinfo = (data = {}) => {
  return request({ url: '/system/v1/user/login/info', method: 'post', data })
}

// 路由查询
export const reqMultiRoles = (data = {}) => {
  return request({ url: '/system/v1/user/login/permission', method: 'post', data })
}

// 获取验证码
export const GetBase64Api = (data: any) => {
  return request({ url: '/infra/v1/captcha/create-base64', method: 'post', data })
}

// 获取角色列表
export const GetRoleListApi = (data: any) => {
  return request({ url: '/system/v1/tenant/role/page', method: 'post', data })
}
// 获取角色权限路由
export const reqAllMenuTreeApi = (data: any) => {
  return request({ url: '/system/v1/tenant/role/resource-tree', method: 'post', data })
}
// 编辑时查询已有角色绑定的权限路由
export const reqRoleresourceApi = (data: any) => {
  return request({ url: '/system/v1/tenant/role/resource', method: 'post', data })
}

// 添加角色
export const reqRoleAddApi = (data: any) => {
  return request({ url: '/system/v1/tenant/role/add', method: 'post', data })
}

// 修改角色绑定路由按钮权限数据
export const reqRoleSaveResourceApi = (data: any) => {
  return request({ url: '/system/v1/tenant/role/save-resource', method: 'post', data })
}

// 删除角色
export const reqDeleteRoleApi = (data: any) => {
  return request({ url: '/system/v1/tenant/role/delete', method: 'post', data })
}
//查询用户列表
export const reqGetUserListApi = (data: any) => {
  return request({ url: '/system/v1/tenant/user/page', method: 'post', data })
}
// 新增用户
export const reqAdduserApi = (data: any) => {
  return request({ url: '/system/v1/tenant/user/save', method: 'post', data })
}

// 分配用户角色权限
export const reqUserSaveRoleApi = (data: any) => {
  return request({ url: '/system/v1/tenant/user/role/save', method: 'post', data })
}
// 查询用户分配角色权限
export const reqUserSaveRoleListApi = (data: any) => {
  return request({ url: '/system/v1/tenant/user/role/list', method: 'post', data })
}
// 修改用户信息
export const reqUpdataUserApi = (data: any) => {
  return request({ url: '/system/v1/tenant/user/modify', method: 'post', data })
}
// 修改用户密码
export const UpdataPasswordApi = (data: any) => {
  return request({ url: '/system/v1/tenant/user/modify-password', method: 'post', data })
}
// 首次登录
export const FirstPasswordApi = (data: any, headers: any) => {
  return request({
    url: '/system/v1/tenant/user/modify-password-first', method: 'post', data, headers: headers
  })
}
// 重置用户密码
export const ResetPasswordApi = (data: any) => {
  return request({
    url: '/system/v1/tenant/user/reset-password', method: 'post', data
  })
}
// 禁用启用账号
export const ResetStatusApi = (data: any) => {
  return request({
    url: '/system/v1/tenant/user/reset-status', method: 'post', data
  })
}
// 编辑角色
export const EditRoleApi = (data: any) => {
  return request({ url: '/system/v1/tenant/role/edit', method: 'post', data })
}

// 获取版本号
export const GetVersionApi = (data: any) => {
  return request({ url: '/system/system/version', method: 'post', data })
}
